import requests
import time
import datetime
def getTargetCors(url):
    xcor,ycor,zcor=0,0,0
    try:
        cors = requests.get(url).json()['imgCor']
        xcor = float(str(cors).split(",")[0][1:])
        ycor = float(str(cors).split(",")[1])
        zcor = float(str(cors).split(",")[2][:-1])
    except:pass
    return xcor,zcor,ycor

if __name__=='__main__':
    # while 1:
    #     url = "http://192.168.174.254:3000/getMinTargetDepth"
    #     xcor,ycor,zcor = getTargetCors(url)
    #     print(xcor,ycor,zcor)
    #     time.sleep(1)
    str='''$PNORI1,4,101028,4,70,0.10,0.20,ENU*07
$PNORS1,052623,171329,0,2EC80402,23.4,1538.4,0.00,215.8,1.8,0.00,180.0,0.00,0.000,0.00,26.71 * 54
$PNORC1,052623,171329,1,0.3,0.214,1.405,-0.723,-0.567,85.3,85.1,85.0,84.5,97,84,52,64 * 66
$PNORC1,052623,171329,2,0.5,-0.065,0.184,0.029,-0.036,84.4,83.8,83.4,83.6,85,99,96,100 * 5D
$PNORC1,052623,171329,3,0.7,-0.092,0.126,0.015,-0.023,80.7,83.3,82.2,81.6,92,100,100,100 * 55
$PNORC1,052623,171329,4,0.9,0.015,0.083,-0.018,-0.010,79.8,80.0,80.6,83.0,100,100,100,100 * 61
$PNORC1,052623,171329,5,1.1,0.120,0.115,-0.071,-0.086,78.7,78.7,80.4,78.5,100,100,92,100 * 57
$PNORC1,052623,171329,6,1.3,-0.072,-0.112,0.006,0.018,79.7,78.7,81.4,78.0,100,100,100,100 * 6F
$PNORC1,052623,171329,7,1.5,-0.204,0.050,0.039,0.069,78.6,77.5,79.1,77.2,100,100,100,100 * 49
$PNORC1,052623,171329,8,1.7,-0.080,-0.132,0.011,-0.022,76.8,75.9,76.0,74.8,80,100,80,84 * 7E
$PNORC1,052623,171329,9,1.9,-0.081,0.014,0.018,-0.063,78.4,76.5,82.4,79.4,78,100,77,45 * 55
$PNORC1,052623,171329,10,2.1,0.127,-0.095,-0.002,-0.065,84.4,82.2,85.3,85.3,100,57,100,100 * 45
$PNORC1,052623,171329,11,2.3,-0.349,0.048,0.476,-0.057,84.4,85.2,83.5,76.5,26,94,23,18 * 58
$PNORC1,052623,171329,12,2.5,0.099,0.147,-0.110,0.017,67.5,79.6,67.5,59.4,42,26,56,62 * 78
$PNORC1,052623,171329,13,2.7,-0.046,-0.100,-0.088,-0.028,53.5,64.0,60.9,58.1,80,90,100,100 * 5D
$PNORC1,052623,171329,14,2.9,0.074,0.084,-0.055,-0.060,47.9,58.4,57.4,48.5,100,86,90,83 * 66
$PNORC1,052623,171329,15,3.1,-0.098,0.168,-0.030,0.016,46.1,49.1,49.2,43.3,100,93,100,98 * 53
$PNORC1,052623,171329,16,3.3,-0.351,-0.034,-0.036,-0.049,41.3,44.6,44.0,41.2,89,100,98,99 * 69
$PNORC1,052623,171329,17,3.5,-0.109,-0.038,-0.058,-0.110,40.4,43.1,41.7,40.9,100,92,97,100 * 52
$PNORC1,052623,171329,18,3.7,-0.096,-0.012,-0.110,-0.116,39.3,44.0,41.3,39.6,99,100,95,95 * 65
$PNORC1,052623,171329,19,3.9,-0.034,0.246,-0.109,-0.109,39.1,42.0,47.3,41.5,88,100,43,2 * 71
$PNORC1,052623,171329,20,4.1,0.017,-0.030,0.009,-0.024,51.3,48.4,62.1,70.6,28,61,58,100 * 67
$PNORC1,052623,171329,21,4.3,0.085,0.099,0.010,0.027,70.0,66.2,72.6,69.2,100,69,100,100 * 68
$PNORC1,052623,171329,22,4.5,0.137,0.033,-0.023,0.119,68.5,76.6,69.8,62.5,100,100,100,49 * 47
$PNORC1,052623,171329,23,4.7,-0.162,0.081,0.105,0.050,58.0,64.5,57.9,49.6,45,44,52,98 * 7F
$PNORC1,052623,171329,24,4.9,-0.067,0.010,0.010,0.009,48.5,54.5,50.0,45.8,100,94,99,100 * 72
$PNORC1,052623,171329,25,5.1,-0.006,-0.058,-0.056,0.005,44.8,48.0,44.8,43.9,100,89,93,100 * 7A
$PNORC1,052623,171329,26,5.3,0.105,-0.103,-0.062,0.008,41.8,44.8,42.4,41.3,98,100,100,96 * 57
$PNORC1,052623,171329,27,5.5,0.050,0.140,-0.014,-0.026,40.2,42.9,41.3,39.6,99,100,100,100 * 66
$PNORC1,052623,171329,28,5.7,0.017,0.089,-0.070,0.023,38.9,41.3,39.2,38.4,96,100,95,94 * 48
$PNORC1,052623,171329,29,5.9,-0.084,-0.004,-0.097,-0.079,37.9,40.5,38.1,37.3,100,100,99,89 * 5F
$PNORC1,052623,171329,30,6.1,-0.019,0.079,-0.071,-0.035,36.5,39.5,37.1,41.3,89,100,84,100 * 7E
$PNORC1,052623,171329,31,6.3,0.124,0.059,-0.009,-0.030,39.8,38.5,41.1,46.1,95,99,92,100 * 6B
$PNORC1,052623,171329,32,6.5,0.010,-0.010,-0.031,0.065,46.8,42.8,46.5,45.8,100,64,100,100 * 6A
$PNORC1,052623,171329,33,6.7,-0.242,0.063,0.006,-0.003,47.5,52.0,47.3,45.1,100,100,100,100 * 54
$PNORC1,052623,171329,34,6.9,0.008,0.141,-0.024,-0.004,45.8,51.2,46.1,44.4,94,100,100,100 * 62
$PNORC1,052623,171329,35,7.1,0.036,0.198,-0.091,-0.034,44.2,49.5,44.8,42.8,100,100,100,100 * 56
$PNORC1,052623,171329,36,7.3,0.110,-0.125,-0.065,-0.093,42.9,47.8,43.3,41.6,100,100,96,100 * 4E
$PNORC1,052623,171329,37,7.5,-0.161,0.035,-0.073,-0.051,41.2,46.4,42.2,40.3,100,100,100,92 * 43
$PNORC1,052623,171329,38,7.7,-0.078,0.001,-0.013,-0.029,40.3,45.5,40.7,39.6,100,100,100,100 * 7D
$PNORC1,052623,171329,39,7.9,-0.021,-0.047,-0.025,-0.023,39.0,43.8,39.6,38.6,100,100,100,100 * 56
$PNORC1,052623,171329,40,8.1,-0.098,0.016,-0.033,-0.047,37.8,42.7,38.7,37.3,92,99,98,96 * 76
$PNORC1,052623,171329,41,8.3,0.003,-0.022,-0.075,-0.064,37.0,41.8,38.2,36.1,100,100,100,88 * 45
$PNORC1,052623,171329,42,8.5,-0.153,0.186,-0.096,-0.104,36.1,40.9,37.1,35.6,79,100,92,87 * 43
$PNORC1,052623,171329,43,8.7,-0.122,-0.053,0.017,0.010,35.5,40.2,36.3,35.0,90,100,97,86 * 65
$PNORC1,052623,171329,44,8.9,-0.092,0.151,-0.144,0.041,35.0,39.4,36.2,34.6,86,100,88,86 * 64
$PNORC1,052623,171329,45,9.1,-0.029,0.119,-0.058,-0.066,34.4,38.7,35.3,34.1,84,95,93,86 * 73
$PNORC1,052623,171329,46,9.3,-0.197,-0.141,-0.240,-0.218,34.1,38.0,35.0,33.5,76,94,79,75 * 50
$PNORC1,052623,171329,47,9.5,-0.231,0.109,-0.164,-0.142,33.5,37.6,34.6,33.5,78,100,87,78 * 43
$PNORC1,052623,171329,48,9.7,-0.185,0.012,-0.163,-0.172,33.5,37.4,34.2,33.3,76,95,80,73 * 72
$PNORC1,052623,171329,49,9.9,-0.152,0.123,-0.235,-0.155,32.8,37.0,34.1,32.6,69,95,72,64 * 7B
$PNORC1,052623,171329,50,10.1,-0.379,0.044,-0.109,-0.216,32.6,36.3,33.9,32.1,68,92,88,73 * 41
$PNORC1,052623,171329,51,10.3,-0.343,-0.026,-0.111,-0.167,32.4,35.6,33.5,32.1,59,80,78,67 * 6D
$PNORC1,052623,171329,52,10.5,-0.221,-0.053,-0.213,-0.173,32.1,35.5,33.2,31.7,66,84,75,64 * 69
$PNORC1,052623,171329,53,10.7,-0.240,-0.028,-0.282,-0.323,31.7,35.0,32.8,31.5,59,90,69,68 * 6F
$PNORC1,052623,171329,54,10.9,-0.198,-0.008,-0.288,-0.208,31.9,35.3,32.8,31.7,62,87,67,59 * 6D
$PNORC1,052623,171329,55,11.1,-0.328,0.158,-0.330,-0.240,31.5,35.0,32.6,31.5,58,93,72,58 * 41
$PNORC1,052623,171329,56,11.3,-0.558,-0.047,-0.444,-0.310,31.2,34.6,32.4,31.2,47,78,72,53 * 66
$PNORC1,052623,171329,57,11.5,-0.245,0.014,-0.357,-0.373,31.2,33.9,32.1,31.0,59,74,59,47 * 41
$PNORC1,052623,171329,58,11.7,-0.379,0.009,-0.246,-0.202,31.2,33.7,31.9,31.0,57,78,62,58 * 49
$PNORC1,052623,171329,59,11.9,-0.268,-0.087,-0.340,-0.368,31.0,33.3,31.9,31.2,48,73,59,55 * 62
$PNORC1,052623,171329,60,12.1,-0.197,0.255,-0.270,-0.295,30.8,33.3,31.7,31.0,55,75,56,53 * 47
$PNORC1,052623,171329,61,12.3,-0.189,0.078,-0.375,-0.284,30.8,32.8,31.5,30.5,54,63,53,55 * 4B
$PNORC1,052623,171329,62,12.5,-0.387,0.333,-0.477,-0.380,30.8,32.8,31.5,30.5,45,73,57,63 * 4E
$PNORC1,052623,171329,63,12.7,-0.395,0.167,-0.374,-0.309,30.5,33.0,31.2,31.0,45,75,56,46 * 4F
$PNORC1,052623,171329,64,12.9,-0.266,-0.101,-0.400,-0.403,30.8,32.4,31.0,30.5,47,67,58,46 * 6E
$PNORC1,052623,171329,65,13.1,-0.037,0.323,-0.494,-0.209,30.8,32.4,30.8,30.2,39,62,42,42 * 43
$PNORC1,052623,171329,66,13.3,-0.377,-0.140,-0.384,-0.279,30.8,32.1,31.0,30.2,45,63,44,45 * 69
$PNORC1,052623,171329,67,13.5,-0.288,-0.133,-0.751,-0.603,30.8,32.1,31.2,30.8,34,52,43,44 * 64
$PNORC1,052623,171329,68,13.7,-0.274,0.078,-0.544,-0.628,30.5,31.7,30.8,30.2,43,51,49,37 * 42
$PNORC1,052623,171329,69,13.9,-0.193,0.127,-0.747,-0.697,30.2,31.7,30.8,30.2,44,51,55,46 * 42
$PNORC1,052623,171329,70,14.1,-0.235,-0.033,-0.487,-0.347,30.5,31.7,30.8,30.2,44,54,46,41 * 63
$PNORBT,1,052623,171329.9338,0.0000,0.0000,0.20823,6553.5,-1.03,0.00000,00 * 20
$PNORBT,2,052623,171329.9338,0.0000,0.0000,0.27516,6553.5,-1.03,0.00000,00 * 2F
$PNORBT,3,052623,171329.9338,0.0000,0.0000,11.19959,6553.5,-1.03,0.00000,00 * 14
$PNORBT,4,052623,171329.9338,0.0000,0.0000,11.19959,6553.5,-1.03,0.00000,00 * 13
$PNORI1,4,101028,4,70,0.10,0.20,ENU * 07
$PNORS1,052623,171330,0,2EC80002,24.0,1538.4,0.00,216.1,1.7,0.00,179.9,0.00,0.000,0.00,26.71 * 51
$PNORC1,052623,171330,1,0.3,0.136,0.368,-0.023,-0.209,85.0,84.0,85.2,85.2,87,72,64,76 * 61
$PNORC1,052623,171330,2,0.5,-0.205,0.200,-0.032,-0.089,84.3,83.7,84.2,83.6,100,100,90,57 * 4C
$PNORC1,052623,171330,3,0.7,-0.047,0.068,-0.006,-0.048,83.6,82.0,82.5,81.7,100,99,100,100 * 71
'''
    str1 = "$PNORI1,4,101028,4,70,0.10,0.20,ENU * 07"
    str2 = "$PNORS1,052623,171330,0,2EC80002,24.0,1538.4,0.00,216.1,1.7,0.00,179.9,0.00,0.000,0.00,26.71 * 51"
    str3 = "$PNORC1,052623,171330,1,0.3,0.136,0.368,-0.023,-0.209,85.0,84.0,85.2,85.2,87,72,64,76 * 61"
